<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>值相等的最小索引</title>
</head>
<body>
  <script>
    function fn(nums) {
      let n = nums.length
      for (let i = 0; i < n; i++) {
          if (i % 10 === nums[i]) {
              return i
          }
      }
      return -1
    }
    console.log(fn([0,1,2]))
  </script>
</body>
</html>